package com.ijunfu.spring.bean._04_bean_controller_advice;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *
 * @title  : 
 * @author : ijunfu <ijunfu@163.com>
 * @date   : 2023/10/31 22:54
 * @version: 1.0
 * @motto  : 位来可期 - 世界很大，我想看看
 *
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Result<T> {

    private Integer code;

    private String message;

    private T data;

    public static Result ok() {
        return new Result(0, "success", null);
    }

    public static Result error() {
        return new Result(-1, "error", null);
    }
}
